package com.mall.user.service;

import com.mall.user.model.dto.address.AddressAddRequest;
import com.mall.user.model.dto.address.AddressUpdateRequest;
import com.mall.user.model.entity.Address;
import com.mall.user.model.vo.AddressVO;

import java.util.List;

/**
 * 地址管理服务接口
 */
public interface AddressService {

    /**
     * 添加地址
     */
    String addAddress(Long userId, AddressAddRequest addressAddRequest);

    /**
     * 更新地址
     */
    boolean updateAddress(Long userId, AddressUpdateRequest addressUpdateRequest);

    /**
     * 删除地址
     */
    boolean deleteAddress(Long userId, String addressId);

    /**
     * 获取用户所有地址
     */
    List<AddressVO> getUserAddresses(Long userId);

    /**
     * 获取地址详情
     */
    AddressVO getAddressById(Long userId, String addressId);

    /**
     * 获取默认地址
     */
    AddressVO getDefaultAddress(Long userId);

    /**
     * 设置默认地址
     */
    boolean setDefaultAddress(Long userId, String addressId);

    /**
     * 转换为VO对象
     */
    AddressVO getAddressVO(Address address);

    /**
     * 批量转换为VO对象
     */
    List<AddressVO> getAddressVO(List<Address> addressList);
}
